package com.ruoyi.safety.mapper;

import java.util.List;
import java.util.Map;


import com.baomidou.mybatisplus.core.mapper.BaseMapper; //添加
import com.ruoyi.safety.domain.SafetyPointRealHistory;
import com.ruoyi.safety.dto.SafetyPointRealTimeDto;
import org.apache.ibatis.annotations.Param;

/**
 * 测点历史信息数据Mapper接口
 *
 * @author ruoyi
 * @date 2024-11-12
 */
public interface SafetyPointRealHistoryMapper extends BaseMapper<SafetyPointRealHistory> //修改
{
    /**
     * 查询测点历史信息数据
     *
     * @param id 测点历史信息数据主键
     * @return 测点历史信息数据
     */
    public SafetyPointRealHistory selectSafetyPointRealHistoryById(String id);

    /**
     * 查询测点历史信息数据列表
     *
     * @param safetyPointRealHistory 测点历史信息数据
     * @return 测点历史信息数据集合
     */
    public List<SafetyPointRealHistory> selectSafetyPointRealHistoryList(SafetyPointRealHistory safetyPointRealHistory);

    /**
     * 新增测点历史信息数据
     *
     * @param safetyPointRealHistory 测点历史信息数据
     * @return 结果
     */
    public int insertSafetyPointRealHistory(SafetyPointRealHistory safetyPointRealHistory);

    /**
     * 修改测点历史信息数据
     *
     * @param safetyPointRealHistory 测点历史信息数据
     * @return 结果
     */
    public int updateSafetyPointRealHistory(SafetyPointRealHistory safetyPointRealHistory);

    /**
     * 删除测点历史信息数据
     *
     * @param id 测点历史信息数据主键
     * @return 结果
     */
    public int deleteSafetyPointRealHistoryById(String id);

    /**
     * 批量删除测点历史信息数据
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteSafetyPointRealHistoryByIds(String[] ids);

    void insertDataBatch();

    int insertDataBatch(List<SafetyPointRealHistory> safetyPointRealHistoryArrayList);

    /**
     * 查询测点历史信息近三天平均数据
     *
     * @return 测点历史信息数据集合
     */
    String selectSafetyPointRealHistoryListThreeAvg(@Param("sensorTypeName") String sensorTypeName, @Param("pointInstallLocation") String pointInstallLocation);

    /**
     * 查询测点历史信息近一天平均数据
     *
     * @return 测点历史信息数据集合
     */
    String selectSafetyPointRealHistoryListOneAvg(@Param("sensorTypeName") String sensorTypeName, @Param("pointInstallLocation") String pointInstallLocation);

    /**
     * 查询测点历史信息自定义时间平均数据
     *
     * @return 测点历史信息数据集合
     */
    String selectSafetyPointRealHistoryListCustomTime(@Param("sensorTypeName")String sensorTypeName,@Param("pointInstallLocation") String pointInstallLocation,@Param("customTime") String customTime);

    void insertDataBatch(Map<String, Object> params);

    /**
     * 获取最新表表名
     */
    String getNewTableName();


    /**
     * 根据传感器名称查询此刻前推1天的监测值list
     * @param queryParam
     * @return
     */
    List<String> getLastDayValueList(String queryParam);

    List<SafetyPointRealTimeDto> getWsLastDayValueList(@Param("wsThreshold") Double wsThreshold);


//    SafetyPointRealHistory getLastDayValueList(String queryParam);

//    int insertDataBatch(List<SafetyPointRealHistory> safetyPointRealHistoryArrayList);
}
